import 'package:flutter/material.dart';

class SearchHome extends StatefulWidget{
  SearchHome({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _SearchHome createState()=>_SearchHome();
}


class _SearchHome extends State<SearchHome>{

  @override
  void initState(){
    surplus = 1;
  }

  int surplus = 0;

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        color: Colors.white,
        padding: EdgeInsets.only(left: 20,right: 20),
        child: Center(
          child: Column(
            children: <Widget>[
              Container(
                margin:EdgeInsets.only(top:98),
                child: Image(
                  image: AssetImage("images/logo.png"),
                  width: 80,
                  height: 80,
                ),
              ),
              Container(
                margin:EdgeInsets.only(top:50),
                decoration: BoxDecoration(
                  color: Colors.white,
                  boxShadow:<BoxShadow>[
                    BoxShadow(
                      color: const Color.fromRGBO(0,0,0,0.15),
                      offset: Offset(0, 10),
                      blurRadius: 20
                    )
                  ]
                ),
                child: Row(
                  children: <Widget>[
                    Expanded(
                      flex: 3,
                      child: TextField(
                          cursorRadius:Radius.circular(9.0),
                          decoration: InputDecoration(
                            hintText: '输入公司全称',
                            contentPadding: const EdgeInsets.symmetric(vertical: 14,horizontal: 15),
                            border:OutlineInputBorder(
                                borderRadius: BorderRadius.only(topLeft:Radius.circular(9.0),bottomLeft:Radius.circular(9.0)),
                                borderSide:BorderSide(color:Color.fromRGBO(0,0,0,0.050980392156862744),width: 1)
                            ),
                            focusedBorder:OutlineInputBorder(
                                borderRadius: BorderRadius.only(topLeft:Radius.circular(9.0),bottomLeft:Radius.circular(9.0)),
                                borderSide:BorderSide(color:Color.fromRGBO(0,0,0,0.050980392156862744),width: 1)
                            ),
                            enabledBorder:OutlineInputBorder(
                                borderRadius: BorderRadius.only(topLeft:Radius.circular(9.0),bottomLeft:Radius.circular(9.0)),
                                borderSide:BorderSide(color:Color.fromRGBO(0,0,0,0.050980392156862744),width: 1)
                            ),
                          )
                      ),
                    ),
                    Expanded(
                      flex: 1,
                      child: DecoratedBox(
                          decoration:BoxDecoration(
                            gradient: LinearGradient(colors: [Color.fromRGBO(10, 207, 254, 1),Color.fromRGBO(73, 90, 255, 1)]),
                            borderRadius: BorderRadius.only(topRight:Radius.circular(9.0),bottomRight:Radius.circular(9.0)),
                          ),
                          child: MaterialButton(
                            child: Text(
                                "搜索",
                                style:TextStyle(fontSize: 15,color: Color.fromRGBO(255, 255, 255, 1))
                            ),
                            onPressed:()=>Navigator.pushNamed(context, "/"),
                          )
                      ),
                    )
                  ],
                )
              ),
              Container(
                margin: EdgeInsets.only(top: 115),
                child: Row(
                  children: <Widget>[
                    Expanded(
                      flex: 1,
                      child: Column(
                        children: <Widget>[
                          Image(
                            image: AssetImage("images/search_item1.png"),
                            width: 30,
                            height: 30,
                          ),
                          Container(
                            margin: EdgeInsets.only(top: 17),
                            child: Text(
                                "报告",
                                style:TextStyle(color: Color.fromRGBO(0,0,0,1),fontSize: 15)
                            ),
                          )
                        ],
                      ),
                    ),
                    Expanded(
                      flex: 1,
                      child: Column(
                        children: <Widget>[
                          Image(
                            image: AssetImage("images/search_item2.png"),
                            width: 30,
                            height: 30,
                          ),
                          Container(
                            margin: EdgeInsets.only(top: 17),
                            child: Text(
                                "购买",
                                style:TextStyle(color: Color.fromRGBO(0,0,0,1),fontSize: 15)
                            ),
                          )
                        ],
                      ),
                    ),
                    Expanded(
                      flex: 1,
                      child: Column(
                        children: <Widget>[
                          Image(
                            image: AssetImage("images/search_item1.png"),
                            width: 30,
                            height: 30,
                          ),
                          Container(
                            margin: EdgeInsets.only(top: 17),
                            child: Text(
                                "记录",
                                style:TextStyle(color: Color.fromRGBO(0,0,0,1),fontSize: 15)
                            ),
                          )
                        ],
                      ),
                    ),
                    Expanded(
                      flex: 1,
                      child: Column(
                        children: <Widget>[
                          Image(
                            image: AssetImage("images/search_item4.png"),
                            width: 30,
                            height: 30,
                          ),
                          Container(
                            margin: EdgeInsets.only(top: 17),
                            child: Text(
                                "我",
                                style:TextStyle(color: Color.fromRGBO(0,0,0,1),fontSize: 15)
                            ),
                          )
                        ],
                      ),
                    )
                  ],
                ),
              ),
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.bottomCenter,
                  padding: EdgeInsets.symmetric(vertical: 30),
                  height: 20,
                  child: Text(
                    "可用余额：${surplus}报告币",
                    textAlign: TextAlign.center,
                    style: TextStyle(
                        fontSize: 14,
                        color: Color.fromRGBO(0,149,10,1)
                    ),
                ))
              )
            ],
          ),
        ),
      )

    );
  }
}